package kr.ac.kd.test;

import java.util.HashMap;

import kr.ac.kd.ServerResponse;
import kr.ac.kd.handler.biz.SearchHandler;

import org.json.kd.JSONObject;

public class RequestAndResponseTestcase {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		SearchHandler handler = new SearchHandler();
		
		HashMap<String, Object> parameters = new HashMap<String, Object>();  // HashMap();
		HashMap<String, String> sConditon = new HashMap<String, String>();  // HashMap();
		sConditon.put("scope", "SEARCHPART1");
		sConditon.put("keyword", "컴퓨");
		sConditon.put("schoolSubject", "컴퓨터");
		sConditon.put("grade", "1학년");
		sConditon.put("term", "1");
		sConditon.put("score", "3.0");
		sConditon.put("dayOrNight", "1");
		sConditon.put("year", "2012");
		
		parameters.put("searchCondition", sConditon);
		
		ServerResponse resp = handler.send("localhost", "8080", "scheduler.search", parameters);
		
		if (resp.isResultFlag()){
			JSONObject resultObject = resp.getResult();
			System.out.println("resultObject : " + resultObject.toString());
		}else{
			System.out.println("error message : " + resp.getResultMessage());
		}
	}
}
